package com.walming.generator.copycat.annotaion.processor.time;

import com.walming.generator.copycat.utils.TimeUtils;

import java.util.Date;

/**
 * 默认的时间处理器-处理为 {@link Date} 对象
 *
 * @author walming
 * @date 2020-09-20 18:34
 */
public class DefaultTimeProcessor implements TimeProcessor<Date> {

    @Override
    public boolean supports(Class<?> clazz) {
        return Date.class.equals(clazz);
    }

    @Override
    public Date handleTime(Long timeStamp, Class<?> clazz) {
        return TimeUtils.toTime(timeStamp, clazz);
    }

}
